import Vue from 'vue'
import Router from 'vue-router'
import Login from '../components/views/Login'
import Register from '../components/views/Register'
import Commodity from "../components/views/Commodity";
import PersonalCenter from "../components/views/PersonalCenter";
import PersonalInfo from "../components/views/PersonalInfo";
import Recharge from "../components/views/Recharge";
import ChangePw from "../components/views/Changepw";
import Shop from "../components/views/Shop";
import Manage from "../components/manage/Manage";
import StockManage from "../components/manage/StockManage";
import EditBook from "../components/manage/EditBook";
import AddBook from "../components/manage/AddBook";
import ShopManage from "../components/manage/ShopManage";
import StatisticsManage from "../components/manage/StatisticsManage";
import ReportManage from "../components/manage/ReportManage";
import ReportManage1 from "../components/manage/ReportManage1";
import AnalysisManage from "../components/manage/AnalysisManage";
import SystemManage from "../components/manage/SystemManage";
import EditUser from "../components/manage/EditUser";
import AddUser from "../components/manage/AddUser";
import Welcome from "../components/views/Welcome";
import Carousel from "../components/views/Carousel";
import Carousel1 from "../components/views/Carousel1";
import Header1 from "../components/views/Header1";
import Header from "../components/views/Header";
import Book from "../components/views/Book";
import Book1 from "../components/views/Book1";
import Browse from "../components/views/Browse";
import RechargeInfo from "../components/views/RechargeInfo";
import LoginInfo from "../components/views/LoginInfo";
import MyOrders from "../components/views/MyOrders";
import Reckoning from "../components/views/Reckoning";
import EditInfo from "../components/views/EditInfo";
import ReportInfo from "../components/manage/ReportInfo";

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Welcome',
      component: Welcome,
      meta: {
        keepAlive: true
      },
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta: {
        keepAlive: true
      },
    },
    {
      path: '/register',
      name: 'Register',
      component: Register,
      meta: {
        keepAlive: true
      },
    },
    {
      path: '/commodity',
      name: 'Commodity',
      component: Commodity,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/personalCenter',
      name: 'PersonalCenter',
      component: PersonalCenter,
      meta: {
        keepAlive: true
      },
    },
    {
      path: '/personalInfo',
      name: 'PersonalInfo',
      component: PersonalInfo,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/recharge',
      name: 'Recharge',
      component: Recharge,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/changePw',
      name: 'ChangePw',
      component: ChangePw,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/shop',
      name: 'Shop',
      component: Shop,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/manage',
      name: 'Manage',
      component: Manage,
      meta: {
        keepAlive: true
      },
    },
    {
      path: '/stockManage',
      name: 'StockManage',
      component: StockManage,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/editBook',
      name: 'EditBook',
      component: EditBook,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/addBook',
      name: 'AddBook',
      component: AddBook,
      meta: {
        keepAlive: true
      },
    },
    {
      path: '/shopManage',
      name: 'ShopManage',
      component: ShopManage,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/statisticsManage',
      name: 'StatisticsManage',
      component: StatisticsManage,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/reportManage',
      name: 'ReportManage',
      component: ReportManage,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/reportManage1',
      name: 'ReportManage1',
      component: ReportManage1,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/analysisManage',
      name: 'AnalysisManage',
      component: AnalysisManage,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/systemManage',
      name: 'SystemManage',
      component: SystemManage,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/editUser',
      name: 'EditUser',
      component: EditUser,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/addUser',
      name: 'AddUser',
      component: AddUser,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/header1',
      name: 'Header1',
      component: Header1,
      meta: {
        keepAlive: true
      },
      redirect:"/carousel",
      children:[
        {
          path: '/carousel',
          name: 'Carousel',
          component: Carousel,
          meta: {
            keepAlive: true
          },
        },
        {
          path: '/book',
          name: 'Book',
          component: Book,
          meta: {
            keepAlive: true
          },
        }
      ]
    },
    {
      path: '/header',
      name: 'Header',
      component: Header,
      meta: {
        keepAlive: true
      },
      redirect:"/carousel1",
      children:[
        {
          path: '/carousel1',
          name: 'Carousel1',
          component: Carousel1,
          meta: {
            keepAlive: true
          },
        },
        {
          path: '/book1',
          name: 'Book1',
          component: Book1,
          meta: {
            keepAlive: true
          },
        }
      ]
    },
    {
      path: '/browse',
      name: 'Browse',
      component: Browse,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/rechargeInfo',
      name: 'RechargeInfo',
      component: RechargeInfo,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/loginInfo',
      name: 'LoginInfo',
      component: LoginInfo,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/myOrders',
      name: 'MyOrders',
      component: MyOrders,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/reckoning',
      name: 'Reckoning',
      component: Reckoning,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/editInfo',
      name: 'EditInfo',
      component: EditInfo,
      meta: {
        keepAlive: false
      },
    },
    {
      path: '/reportInfo',
      name: 'ReportInfo',
      component: ReportInfo,
      meta: {
        keepAlive: false
      },
    }
  ]
})
